<include file="Public/header" />
<title>仓库管理</title>
</head>
<style type="text/css">
    label{
        display: block;
        float: left;
        height: 30px;
        margin-left: 12px;
    }
</style>
<body>
<div class="page-container">
    <div class="mt-20">
        <div id="ipt" style="overflow: auto">
            <foreach name="list" item="data">
            <label><input type="checkbox" <eq name="data.checked" value="1">checked</eq> value="<{$data.id}>"><{$data.name}>-<{$data.username}></label>
            </foreach>
        </div>
        <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper no-footer">
            <div style="margin-top: 32px;">
                <a href="javascript:;" tabindex="<{$list_id}>" onclick="warehouse_edit(this)" class="btn btn-primary radius">确定修改</a>
                <a href="javascript:;" onclick="cancel()" class="btn btn-default radius">取消</a>
            </div>
        </div>
    </div>
    </div>
    <include file="Public/footer" />
    <include file="Public/footer_js" />
    <script>
        function warehouse_edit(){
            var all_ipt=$("#ipt input[type=checkbox]:checked");
            var group_id='';
            for(var i=0;i<all_ipt.length;i++){
                if(all_ipt.eq(i).val()!==''){
                    group_id+='@'+all_ipt.eq(i).val();
                }
            }
            if(group_id.substring(1)==''){
                layer.msg('请勾选仓库');
                return false;
            }
            var id=group_id.substring(1);
            var user_id='<{$user_id}>';
            $.get('__MODULE__/Company/warehouseEditD',{
                id:id,
                user_id:user_id,
            },function (msg){
                layer.msg(msg.data);
                if(msg.flag==1){
                    setTimeout(function (){
                        location.reload();
                    },800);
                }
            },'json');
        }
        function cancel(){
            parent.layer.closeAll();
        }
    </script>
</body>
</html>